package com.leet.code.simple_array;

/**
 * @description:    1295.统计位数为偶数的数字
 * @author: WYG
 * @time: 2020/12/30 16:28
 */

public class FindNumbers {
    public int findNumbers(int[] nums) {
        int res = 0;
        for (int i = 0; i < nums.length; i++) {
            if ((9 < nums[i] && nums[i] < 100) || (999 < nums[i] && nums[i] < 10000) || nums[i] == 100000) {
                res++;
            }
        }
        return res;
    }

    public int new_findNumbers(int[] nums) {
        int res = 0;
        for (int i = 0; i < nums.length; i++) {
            if (((int)Math.log10(nums[i]) + 1) % 2 == 0) {
                res++;
            }
        }
        return res;
    }
}
